
/**
 * 介绍父类与子类的关系，概念
 */
class Animal {
    public String name;
    private int age;
    public String color;



    public void sleep() {
        System.out.println(this.name+"正在睡觉");

    }
}
class Dog extends Animal {
    public String number;

    public void eat() {
        System.out.println(this.name+"正在吃狗粮");
    }


}


public class Test1 {

    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "旺财";

        dog.sleep();
        dog.eat();
    }

}
